enable QA bf16 pipeline#34483
Merged
Rocketknight1 merged 3 commits intohuggingface:mainfrom Oct 31, 2024
Merged
Conversation
Contributor
Author
|
The issue can be reproduced by: import torch
from transformers import pipeline
question = "How many programming languages does BLOOM support?"
context = "BLOOM has 176 billion parameters and can generate text in 46 languages natural languages and 13 programming languages."
question_answerer = pipeline("question-answering", model="bert-large-uncased-whole-word-masking-finetuned-squad", torch_dtype=torch.bfloat16)
out = question_answerer(question=question, context=context) |
Contributor
Author
|
Hi @Rocketknight1 , could you please review this PR ? Thx! |
Rocketknight1
approved these changes
Oct 31, 2024
Member
Rocketknight1
left a comment
There was a problem hiding this comment.
Yes, good fix, and thank you for the clean reproducer!
Member
|
Merging without core maintainer review since this is a straightforward pipeline dtype fix that shouldn't have any side effects |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
BernardZach
pushed a commit
to BernardZach/transformers
that referenced
this pull request
Dec 5, 2024
* enable QA bf16 pipeline * add tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @SunMarc @ArthurZucker
The same issue as #31625 . Numpy can only process fp32 data type but the input tensor could be bf16/fp16 based on the model's dtype. Please review it, thx!